home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 419_01 / odmg10 / util / scripts / xmkmf.cpp < prev   
Encoding:
Text File  |  1993-09-09  |  632 b   |  36 lines

  1. /**/#!/bin/sh
  2.  
  3. /**/#
  4. /**/# generate a Makefile from an Imakefile from inside or outside the sources!
  5. /**/# 
  6.  
  7. usage="usage:  $0 [top_of_sources_pathname [current_directory]]"
  8.  
  9. topdir=
  10. curdir=.
  11.  
  12. case $# in 
  13.     0) ;;
  14.     1) topdir=$1 ;;
  15.     2) topdir=$1  curdir=$2 ;;
  16.     *) echo "$usage" 1>&2; exit 1 ;;
  17. esac
  18.  
  19. case "$topdir" in
  20.     -*) echo "$usage" 1>&2; exit 1 ;;
  21. esac
  22.  
  23. if [ -f Makefile ]; then 
  24.     echo mv Makefile Makefile.bak
  25.     mv Makefile Makefile.bak
  26. fi
  27.  
  28. if [ "$topdir" = "" ]; then
  29.     args="-DUseInstalled "CONFIGDIRSPEC
  30. else
  31.     args="-I$topdir/config -DTOPDIR=$topdir -DCURDIR=$curdir"
  32. fi
  33.  
  34. echo imake $args
  35. imake $args
  36.